<?php
date_default_timezone_set('Asia/Shanghai');
include "TopSdk.php";

 
$c = new DingTalkClient(DingTalkConstant::$CALL_TYPE_OAPI, DingTalkConstant::$METHOD_POST , DingTalkConstant::$FORMAT_JSON);
$req = new OapiSnsGetuserinfoBycodeRequest;
$code = $_REQUEST['code'];

$req->setTmpAuthCode($code);

$appId = 'dingoafwbijwwfm23aqrfz';
$appSecret = 'lC749udhclPObrEFPieA9w7cLPiz5F16fTElf-_xvdfe5izhhR0QnRrvTYO3KvJs';
 
$resp=$c->executeWithAccessKey($req, "https://oapi.dingtalk.com/sns/getuserinfo_bycode",$appId ,$appSecret);
echo "<pre>";
var_dump($resp)

?>